-
Notifications
You must be signed in to change notification settings - Fork 326
WIP: add image customization generation script #3358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Interesting. Do you have an example regarding how you use the image-customization-helper.lua in a site's image-customization.lua? Could this toh.json also be used to simplify package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua? If this were added to the main repository would refreshing of the image-customization-helper.lua also need to be added to the device integration checklist? I'm also wondering if it were possible to avoid having to refresh and recommit the image-customization-helper.lua. (maybe just generate image-customization-helper.lua during a "make update" and don't add it to Git? Write it to ./gluon/tmp/ or ./gluon/output/? Or at least somewhere that's in a .gitignore. And make the result available to image-customization.lua that doesn't require explicitly including the helper file?) |
Hi @T-X,
my current (but untested) commit to this is ffac/site@89d627d which makes the idea clear.
as said by @neocturne the platform.lua uses a different format (for example requires to have Furthermore, my current approach using the device id fails for some devices as well (for example for the
yes, that would be the case (and making sure that the data is correct in the toh, which is cumbersome, as I heard that the openwrt wiki was separated from the development by intention, so I don't think it is helpful to tie these together here.
automatic generation adds a side effect to the build process which might cause weird problems "package x does not include y anymore" - "oh someone edited the wiki" or "build failed, openwrt was down" and especially for building older releases it is required to have the matching helper.lua at hand, so I am quite sure this should be added to the VCS and updated manually. |
21b0165
to
a5f18e5
Compare
The following 116 models do not have a matching device id in openwrt wiki: Without matching Device ID
The following 172 supported devices have a matching id: With matching Device ID
I am currently mapping this using a custom device_mapping like this: # mapping from openwrt device_id to gluon name
device_mappings = {
"ubiquiti-unifi-uk-ultra": "ubiquiti-unifi-swiss-army-knife-ultra",
"ubiquiti-unifi-outdoorplus": "ubiquiti-unifi-ap-outdoor+",
"ubiquiti-unifi-ac-mesh-pro" : "",
"ubiquiti-unifi-ac-mesh": "ubiquiti-unifi-ac-mesh-pro",
"openwrt-one-1": "openwrt-one",
"linksys-e8450": "linksys-e8450-ubi",
"zyxel-nbg6716-a01": "zyxel-nbg6716",
"cudy-x6": "cudy-x6-v1",
"sophos-ap100-rev-1": "sophos-ap100",
"sophos-ap100c-rev-1": "sophos-ap100c",
"sophos-ap55-rev-1": "sophos-ap55",
"sophos-ap55c-rev-1": "sophos-ap55c",
} but this is of course one of the drawbacks of this approach. Correctly receiving the toh.json automatically became much worse due to crawlers, as the service responds with 5xx if queried very soon again. |
this script creates the helper lua from the openwrt toh to be included in the image-customization.lua
a5f18e5
to
6ddb9a8
Compare
this script creates the helper lua from the openwrt toh to be included in the image-customization.lua
closes #3316
supersedes #3143
Eventually, this should stay in community-packages or something less official, though I like that this properly depends on the wiki as well, making it easier to correct things for anyone.
I was made aware of the toh.json through this TOH viewer for Openwrt: https://github.com/soif/OpenWrtTOH/